﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once        
#include "IFamilyDimensionConstraint.h"
#include "GmFamilyService.h"

namespace gfam
{

    /// \brief  角度约束 ,支持圆心角，线线角，线面角
    class GM_FAMILY_SERVICE_EXPORT IFamilyAngleConstraint : public IFamilyDimensionConstraint
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyAngleConstraint, gfam::IFamilyDimensionConstraint)
    public:


        /// \brief  创建角度约束
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  option  创建选项
        /// \return 角度约束
        static IFamilyAngleConstraint* Create(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, gcmp::ElementCreationOptions option = gcmp::ElementCreationOptions::Normal);

        /// \brief  创建角度约束
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  coord 坐标系
        /// \param  option  创建选项
        /// \return 角度约束
        static IFamilyAngleConstraint* Create(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId,
            const gcmp::ElementId& sketchPlaneId, const gcmp::Coordinate3d& coord, gcmp::ElementCreationOptions eco = gcmp::ElementCreationOptions::Normal);


        /// \brief  设置顺时针标记
        ///
        /// \param  clockSign  标记
        virtual void SetClockSign(bool clockSign) = 0;

        /// \brief  获取是否逆时针
        ///
        /// \return  逆时针返回true,否则返回false
        virtual bool IsAntiClockwise() const = 0;


        /// \brief  设置标注半径
        ///
        /// \param  radius  半径
        virtual void SetRadius(double radius) = 0;

        /// \brief  获取标注半径
        ///
        /// \return  半径值
        virtual double GetRadius() const = 0;

        /// \brief  设置平面法向标记
        ///
        /// \param  planeNormalSign 法向标记
        virtual void SetPlaneNormalSign(int planeNormalSign) = 0;


        /// \brief  计算两直线段间的角度约束顺逆时针,所在象限,标注半径,显示角度和实际角度值
        ///
        /// \return  成功返回true,否则返回false
        virtual bool CalcAngleDim() = 0;

        /// \brief  设置显示角度值
        ///
        /// \param  visualValue  角度值
        virtual void SetVisualValue(double visualValue) = 0;

        /// \brief  获取显示角度值
        ///
        /// \return  显示角度值
        virtual double GetVisualValue() const = 0;

        /// \brief  设置象限
        ///
        /// \param  quadrant  象限(取值范围：1 、2、3、4)
        virtual void SetQuadrant(int quadrant) = 0;

        /// \brief  获取象限
        ///
        /// \return  象限
        virtual int GetQuadrant() const = 0;
    };
}